/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Memento2;

/**
 *
 * @author lcc
 */
public class Main {
    
    
    public static void main(String[] args) {
         Caretaker c = new Caretaker();
         
         Originator originator = new Originator();
         originator.setState("EstadoA");
         c.add(originator.createMemento());
         originator.setState("EstadoB");
         c.add(originator.createMemento());
         originator.setState("EstadoC");
         c.add(originator.createMemento());
         originator.setState("EstadoD");
         c.add(originator.createMemento());
         originator.setState("EstadoE");
         c.add(originator.createMemento());
         originator.setMemento(c.remove());
         originator.setMemento(c.remove());
         originator.setMemento(c.remove());
         originator.setState("EstadoE");
         c.add(originator.createMemento());
         originator.setMemento(c.remove());
         
         System.out.println(originator.getState());
    }
}
